package com.apesay.test;

/**
 * ClassName:User
 * Reason:	 
 * Date:     2017/11/1 15:24
 *
 * @author sid
 */
public class User implements IUser {
    private String name;
    private int age;

    public User() {
    }

    public User(String name, int age) {
        this.name = name;
        this.age = age;
    }

    public boolean isAdult(){
        try {
            Thread.sleep(10);
            System.out.println(name+" is adult:"+(age>18));
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        return age>18;
    }

    public boolean isChild(){
        try {
            Thread.sleep(10);
            System.out.println(name+" is child:"+(age<18));
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        return age<18;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }
}
